pub mod event;
pub mod memory;
pub mod task;

use crate::system_table::EfiTableHeader;

use self::{
    event::{
        EfiCheckEvent, EfiCloseEvent, EfiCreateEvent, EfiSetTimer, EfiSignalEvent, EfiWaitForEvent,
    },
    memory::{EfiAllocatePages, EfiAllocatePool, EfiFreePages, EfiFreePool, EfiGetMemoryMap},
    task::{EfiRaiseTpl, EfiRestoreTpl},
};

/// ## 任务优先级服务：
///
/// + [`raise_tpl`](EfiBootServices::raise_tpl)
/// + [`restore_tpl`](EfiBootServices::restore_tpl)
///
/// ## 内存服务
///
/// + [`allocate_pates`](EfiBootServices::allocate_pates)
/// + [`free_pages`](EfiBootServices::free_pages)
/// + [`get_memory_map`](EfiBootServices::get_memory_map)
/// + [`allocate_pool`](EfiBootServices::allocate_pool)
/// + [`free_pool`](EfiBootServices::free_pool)
///
/// ## 事件和定时器服务
///
///
/// + [`create_event`](EfiBootServices::create_event)
/// + [`set_timer`](EfiBootServices::set_timer)
/// + [`wait_for_event`](EfiBootServices::wait_for_event)
/// + [`signal_event`](EfiBootServices::signal_event)
/// + [`close_event`](EfiBootServices::close_event)
/// + [`check_event`](EfiBootServices::check_event)
#[repr(C)]
pub struct EfiBootServices {
    pub hdr: EfiTableHeader,

    // 任务优先级服务
    pub raise_tpl: EfiRaiseTpl,
    pub restore_tpl: EfiRestoreTpl,

    // 内存服务
    pub allocate_pages: EfiAllocatePages,
    pub free_pages: EfiFreePages,
    pub get_memory_map: EfiGetMemoryMap,
    pub allocate_pool: EfiAllocatePool,
    pub free_pool: EfiFreePool,

    // 事件和定时器服务
    pub create_event: EfiCreateEvent,
    pub set_timer: EfiSetTimer,
    pub wait_for_event: EfiWaitForEvent,
    pub signal_event: EfiSignalEvent,
    pub close_event: EfiCloseEvent,
    pub check_event: EfiCheckEvent,
}
impl EfiBootServices {
    pub const SIGNATURE: u64 = 0x56524553544f4f42;
}
